home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / p_man / cat3 / complib / dgbsvx.z / dgbsvx
Text File  |  1998-10-30  |  14KB  |  331 lines

  1.  
  2.  
  3.  
  4. DDDDGGGGBBBBSSSSVVVVXXXX((((3333FFFF))))                                                          DDDDGGGGBBBBSSSSVVVVXXXX((((3333FFFF))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      DGBSVX - use the LU factorization to compute the solution to a real
  10.      system of linear equations A * X = B, A**T * X = B, or A**H * X = B,
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      SUBROUTINE DGBSVX( FACT, TRANS, N, KL, KU, NRHS, AB, LDAB, AFB, LDAFB,
  14.                         IPIV, EQUED, R, C, B, LDB, X, LDX, RCOND, FERR, BERR,
  15.                         WORK, IWORK, INFO )
  16.  
  17.          CHARACTER      EQUED, FACT, TRANS
  18.  
  19.          INTEGER        INFO, KL, KU, LDAB, LDAFB, LDB, LDX, N, NRHS
  20.  
  21.          DOUBLE         PRECISION RCOND
  22.  
  23.          INTEGER        IPIV( * ), IWORK( * )
  24.  
  25.          DOUBLE         PRECISION AB( LDAB, * ), AFB( LDAFB, * ), B( LDB, * ),
  26.                         BERR( * ), C( * ), FERR( * ), R( * ), WORK( * ), X(
  27.                         LDX, * )
  28.  
  29. PPPPUUUURRRRPPPPOOOOSSSSEEEE
  30.      DGBSVX uses the LU factorization to compute the solution to a real system
  31.      of linear equations A * X = B, A**T * X = B, or A**H * X = B, where A is
  32.      a band matrix of order N with KL subdiagonals and KU superdiagonals, and
  33.      X and B are N-by-NRHS matrices.
  34.  
  35.      Error bounds on the solution and a condition estimate are also provided.
  36.  
  37.  
  38. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  39.      The following steps are performed by this subroutine:
  40.  
  41.      1. If FACT = 'E', real scaling factors are computed to equilibrate
  42.         the system:
  43.            TRANS = 'N':  diag(R)*A*diag(C)     *inv(diag(C))*X = diag(R)*B
  44.            TRANS = 'T': (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
  45.            TRANS = 'C': (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
  46.         Whether or not the system will be equilibrated depends on the
  47.         scaling of the matrix A, but if equilibration is used, A is
  48.         overwritten by diag(R)*A*diag(C) and B by diag(R)*B (if TRANS='N')
  49.         or diag(C)*B (if TRANS = 'T' or 'C').
  50.  
  51.      2. If FACT = 'N' or 'E', the LU decomposition is used to factor the
  52.         matrix A (after equilibration if FACT = 'E') as
  53.            A = L * U,
  54.         where L is a product of permutation and unit lower triangular
  55.         matrices with KL subdiagonals, and U is upper triangular with
  56.         KL+KU superdiagonals.
  57.  
  58.      3. The factored form of A is used to estimate the condition number
  59.         of the matrix A.  If the reciprocal of the condition number is
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. DDDDGGGGBBBBSSSSVVVVXXXX((((3333FFFF))))                                                          DDDDGGGGBBBBSSSSVVVVXXXX((((3333FFFF))))
  71.  
  72.  
  73.  
  74.         less than machine precision, steps 4-6 are skipped.
  75.  
  76.      4. The system of equations is solved for X using the factored form
  77.         of A.
  78.  
  79.      5. Iterative refinement is applied to improve the computed solution
  80.         matrix and calculate error bounds and backward error estimates
  81.         for it.
  82.  
  83.      6. If equilibration was used, the matrix X is premultiplied by
  84.         diag(C) (if TRANS = 'N') or diag(R) (if TRANS = 'T' or 'C') so
  85.         that it solves the original system before equilibration.
  86.  
  87.  
  88. AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  89.      FACT    (input) CHARACTER*1
  90.              Specifies whether or not the factored form of the matrix A is
  91.              supplied on entry, and if not, whether the matrix A should be
  92.              equilibrated before it is factored.  = 'F':  On entry, AFB and
  93.              IPIV contain the factored form of A.  If EQUED is not 'N', the
  94.              matrix A has been equilibrated with scaling factors given by R
  95.              and C.  AB, AFB, and IPIV are not modified.  = 'N':  The matrix A
  96.              will be copied to AFB and factored.
  97.              = 'E':  The matrix A will be equilibrated if necessary, then
  98.              copied to AFB and factored.
  99.  
  100.      TRANS   (input) CHARACTER*1
  101.              Specifies the form of the system of equations.  = 'N':  A * X = B
  102.              (No transpose)
  103.              = 'T':  A**T * X = B  (Transpose)
  104.              = 'C':  A**H * X = B  (Transpose)
  105.  
  106.      N       (input) INTEGER
  107.              The number of linear equations, i.e., the order of the matrix A.
  108.              N >= 0.
  109.  
  110.      KL      (input) INTEGER
  111.              The number of subdiagonals within the band of A.  KL >= 0.
  112.  
  113.      KU      (input) INTEGER
  114.              The number of superdiagonals within the band of A.  KU >= 0.
  115.  
  116.      NRHS    (input) INTEGER
  117.              The number of right hand sides, i.e., the number of columns of
  118.              the matrices B and X.  NRHS >= 0.
  119.  
  120.      AB      (input/output) DOUBLE PRECISION array, dimension (LDAB,N)
  121.              On entry, the matrix A in band storage, in rows 1 to KL+KU+1.
  122.              The j-th column of A is stored in the j-th column of the array AB
  123.              as follows:  AB(KU+1+i-j,j) = A(i,j) for max(1,j-
  124.              KU)<=i<=min(N,j+kl)
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. DDDDGGGGBBBBSSSSVVVVXXXX((((3333FFFF))))                                                          DDDDGGGGBBBBSSSSVVVVXXXX((((3333FFFF))))
  137.  
  138.  
  139.  
  140.              If FACT = 'F' and EQUED is not 'N', then A must have been
  141.              equilibrated by the scaling factors in R and/or C.  AB is not
  142.              modified if FACT = 'F' or 'N', or if FACT = 'E' and EQUED = 'N'
  143.              on exit.
  144.  
  145.              On exit, if EQUED .ne. 'N', A is scaled as follows:  EQUED = 'R':
  146.              A := diag(R) * A
  147.              EQUED = 'C':  A := A * diag(C)
  148.              EQUED = 'B':  A := diag(R) * A * diag(C).
  149.  
  150.      LDAB    (input) INTEGER
  151.              The leading dimension of the array AB.  LDAB >= KL+KU+1.
  152.  
  153.      AFB     (input or output) DOUBLE PRECISION array, dimension (LDAFB,N)
  154.              If FACT = 'F', then AFB is an input argument and on entry
  155.              contains details of the LU factorization of the band matrix A, as
  156.              computed by DGBTRF.  U is stored as an upper triangular band
  157.              matrix with KL+KU superdiagonals in rows 1 to KL+KU+1, and the
  158.              multipliers used during the factorization are stored in rows
  159.              KL+KU+2 to 2*KL+KU+1.  If EQUED .ne. 'N', then AFB is the
  160.              factored form of the equilibrated matrix A.
  161.  
  162.              If FACT = 'N', then AFB is an output argument and on exit returns
  163.              details of the LU factorization of A.
  164.  
  165.              If FACT = 'E', then AFB is an output argument and on exit returns
  166.              details of the LU factorization of the equilibrated matrix A (see
  167.              the description of AB for the form of the equilibrated matrix).
  168.  
  169.      LDAFB   (input) INTEGER
  170.              The leading dimension of the array AFB.  LDAFB >= 2*KL+KU+1.
  171.  
  172.      IPIV    (input or output) INTEGER array, dimension (N)
  173.              If FACT = 'F', then IPIV is an input argument and on entry
  174.              contains the pivot indices from the factorization A = L*U as
  175.              computed by DGBTRF; row i of the matrix was interchanged with row
  176.              IPIV(i).
  177.  
  178.              If FACT = 'N', then IPIV is an output argument and on exit
  179.              contains the pivot indices from the factorization A = L*U of the
  180.              original matrix A.
  181.  
  182.              If FACT = 'E', then IPIV is an output argument and on exit
  183.              contains the pivot indices from the factorization A = L*U of the
  184.              equilibrated matrix A.
  185.  
  186.      EQUED   (input or output) CHARACTER*1
  187.              Specifies the form of equilibration that was done.  = 'N':  No
  188.              equilibration (always true if FACT = 'N').
  189.              = 'R':  Row equilibration, i.e., A has been premultiplied by
  190.              diag(R).  = 'C':  Column equilibration, i.e., A has been
  191.              postmultiplied by diag(C).  = 'B':  Both row and column
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. DDDDGGGGBBBBSSSSVVVVXXXX((((3333FFFF))))                                                          DDDDGGGGBBBBSSSSVVVVXXXX((((3333FFFF))))
  203.  
  204.  
  205.  
  206.              equilibration, i.e., A has been replaced by diag(R) * A *
  207.              diag(C).  EQUED is an input argument if FACT = 'F'; otherwise, it
  208.              is an output argument.
  209.  
  210.      R       (input or output) DOUBLE PRECISION array, dimension (N)
  211.              The row scale factors for A.  If EQUED = 'R' or 'B', A is
  212.              multiplied on the left by diag(R); if EQUED = 'N' or 'C', R is
  213.              not accessed.  R is an input argument if FACT = 'F'; otherwise, R
  214.              is an output argument.  If FACT = 'F' and EQUED = 'R' or 'B',
  215.              each element of R must be positive.
  216.  
  217.      C       (input or output) DOUBLE PRECISION array, dimension (N)
  218.              The column scale factors for A.  If EQUED = 'C' or 'B', A is
  219.              multiplied on the right by diag(C); if EQUED = 'N' or 'R', C is
  220.              not accessed.  C is an input argument if FACT = 'F'; otherwise, C
  221.              is an output argument.  If FACT = 'F' and EQUED = 'C' or 'B',
  222.              each element of C must be positive.
  223.  
  224.      B       (input/output) DOUBLE PRECISION array, dimension (LDB,NRHS)
  225.              On entry, the right hand side matrix B.  On exit, if EQUED = 'N',
  226.              B is not modified; if TRANS = 'N' and EQUED = 'R' or 'B', B is
  227.              overwritten by diag(R)*B; if TRANS = 'T' or 'C' and EQUED = 'C'
  228.              or 'B', B is overwritten by diag(C)*B.
  229.  
  230.      LDB     (input) INTEGER
  231.              The leading dimension of the array B.  LDB >= max(1,N).
  232.  
  233.      X       (output) DOUBLE PRECISION array, dimension (LDX,NRHS)
  234.              If INFO = 0, the N-by-NRHS solution matrix X to the original
  235.              system of equations.  Note that A and B are modified on exit if
  236.              EQUED .ne. 'N', and the solution to the equilibrated system is
  237.              inv(diag(C))*X if TRANS = 'N' and EQUED = 'C' or or 'B'.
  238.  
  239.      LDX     (input) INTEGER
  240.              The leading dimension of the array X.  LDX >= max(1,N).
  241.  
  242.      RCOND   (output) DOUBLE PRECISION
  243.              The estimate of the reciprocal condition number of the matrix A
  244.              after equilibration (if done).  If RCOND is less than the machine
  245.              precision (in particular, if RCOND = 0), the matrix is singular
  246.              to working precision.  This condition is indicated by a return
  247.              code of INFO > 0, and the solution and error bounds are not
  248.              computed.
  249.  
  250.      FERR    (output) DOUBLE PRECISION array, dimension (NRHS)
  251.              The estimated forward error bound for each solution vector X(j)
  252.              (the j-th column of the solution matrix X).  If XTRUE is the true
  253.              solution corresponding to X(j), FERR(j) is an estimated upper
  254.              bound for the magnitude of the largest element in (X(j) - XTRUE)
  255.              divided by the magnitude of the largest element in X(j).  The
  256.              estimate is as reliable as the estimate for RCOND, and is almost
  257.              always a slight overestimate of the true error.
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. DDDDGGGGBBBBSSSSVVVVXXXX((((3333FFFF))))                                                          DDDDGGGGBBBBSSSSVVVVXXXX((((3333FFFF))))
  269.  
  270.  
  271.  
  272.      BERR    (output) DOUBLE PRECISION array, dimension (NRHS)
  273.              The componentwise relative backward error of each solution vector
  274.              X(j) (i.e., the smallest relative change in any element of A or B
  275.              that makes X(j) an exact solution).
  276.  
  277.      WORK    (workspace/output) DOUBLE PRECISION array, dimension (3*N)
  278.              On exit, WORK(1) contains the reciprocal pivot growth factor
  279.              norm(A)/norm(U). The "max absolute element" norm is used. If
  280.              WORK(1) is much less than 1, then the stability of the LU
  281.              factorization of the (equilibrated) matrix A could be poor. This
  282.              also means that the solution X, condition estimator RCOND, and
  283.              forward error bound FERR could be unreliable. If factorization
  284.              fails with 0<INFO<=N, then WORK(1) contains the reciprocal pivot
  285.              growth factor for the leading INFO columns of A.
  286.  
  287.      IWORK   (workspace) INTEGER array, dimension (N)
  288.  
  289.      INFO    (output) INTEGER
  290.              = 0:  successful exit
  291.              < 0:  if INFO = -i, the i-th argument had an illegal value
  292.              > 0:  if INFO = i, and i is
  293.              <= N:  U(i,i) is exactly zero.  The factorization has been
  294.              completed, but the factor U is exactly singular, so the solution
  295.              and error bounds could not be computed.  = N+1: RCOND is less
  296.              than machine precision.  The factorization has been completed,
  297.              but the matrix A is singular to working precision, and the
  298.              solution and error bounds have not been computed.
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.